<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Chonmau extends MX_Controller 
{
	protected $lang ;
	function __construct() 
	{
		parent::__construct();	
		$this->load->config('config_site') ;
		$this->load->model('chonmau_model','chonmau');
		$this->lang = get_languages() ;
		$this->chonmau->initialise($this->lang) ;
		$this->pre_message="";
	}
	
	function index()
	{
		$data['title'] = "Chọn mẫu in" ;
		$data['list'] = $this->chonmau->getCategory('category') ;//trit($data['list']);
		$data['page'] = 'chonmau/index' ;
		$this->load->view('layout/skin', $data);
	}
	// get all category
	function category($cat_id){
		$data['title'] = "Chọn mẫu in" ;
		$data['list']=$this->chonmau->getAllCat('product',$cat_id);//trit(count($data['list']));
		$this->load->view('chonmau/mau', $data);
		$data['seg']=$this->uri->segment(1);
	}
	// get item of category
	function detail($id){
		$data['title'] = "Chọn mẫu in" ;
		$data['rs']=$this->chonmau->getId($id,'product');
		$data['page'] = 'chonmau/detail' ;
		$this->load->view('layout/skin', $data);
	}
}
?>